//
//  CNHotViewModel.m
//  BeeQuick_19
//
//  Created by whong7 on 16/9/23.
//  Copyright © 2016年 CN Team. All rights reserved.
//

#import "CNHotViewModel.h"
#import "CNHotModel.h"

@interface CNHotViewModel ()

@end

@implementation CNHotViewModel

+(void)loadDataWithBlock:(void(^)(CNHotModel *model)) hotBlock
{
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    
    [param setValue:@"6" forKey:@"call"];
    
    [[CNHTTPSessionManager sharedManager] request:CNHttpMethodPost componentUrlString:@"search.json.php" parameters:param completion:^(id response, NSError *error) {
        
        NSLog(@"%@",response);
        if (response) {
           
            CNHotModel *model = [CNHotModel yy_modelWithJSON:response];
            hotBlock(model);
        }
        else
        {
            NSLog(@"%@",error);
   
        }
    }];
}



@end
